import dayjs from 'dayjs';

const startDay = '2023-01-01';
const endDay = '2023-12-31';
const result = [];

const getData = () => {
    const startTime = new Date(startDay).getTime();
    const endTime = new Date(endDay).getTime();
    const cha = endTime - startTime;
    const oneDay = 1 * 24 * 60 * 60 * 1000;
    const d = cha / oneDay;
    for (let i = 0; i <= d; i++) {
        const t = startTime + oneDay * i;
        const name = dayjs(t).format('YYYY-MM-DD');
        const airChanges = -(Math.random() * 0.3 +0.3).toFixed(2);
        const airVolume = parseInt(Math.random() * 12000 + 230);
        const color = Math.random() > 0.5 ? '#246FE5' : '#F55047';
        result.push({
            color,
            name,
            airChanges,
            airVolume
        });
    }
    return result;
};
export default getData();
